﻿@{
    Layout = null;
}
<link href="~/Content/TraceSource/main.css" rel="stylesheet" />
<script src="~/Scripts/MGJJS/OriginsMaterial/OriginsMaterialList.js"></script>
<script src="~/Scripts/MGJJS/TraceSource/PageOperation/jquery.qrcode.min.js"></script>

<style>
    .TSB_BodyTop
    {
        background: #f8f8f8;
        padding: 15px 38px;
        box-shadow: 0 0 1px rgba(0,0,0,.15);
    }

    .TSB_Label
    {
        cursor: pointer;
        width: 16px;
        height: 16px;
        border: 1px solid #999999;
        border-radius: 4px;
        position: relative;
        top: 4px;
    }

    .TSB_Label > input
    {
        opacity: 0;
    }

    .TSB_Body > li
    {
        box-shadow: 0 0 1px rgba(0,0,0,.15);
        padding: 15px 10px;
        display: -webkit-box;
        clear:both;
        height:100%;
        width:100%;
    }

    .div_icon
    {
        width: 40px;
        height: 40px;
        line-height: 40px;
        border-radius: 20px;
        background: #6cc788;
        display: inline-block;
        text-align: center;
        color: #FFFFFF;
    }

    .TSB_Body_Img
    {
        display: block;
        width: 90px;
        height: 70px;
        border-radius:3px;
    }

    .TSB_Body > li:hover
    {
        background-color: #f8f8f8;
    }

    .TSB_Body .btn-default
    {
        border: 1px solid #999999;
        margin: 0 5px;
    }
    .TSB_Body .btn {
        margin: 0 5px;
    }
    .TSB_BodyTop .btn {
        margin-left: 10px;
    }
    .Icon_Common {
        background: url(../../../Content/webImgs/TraceSource/OriginsMaterialList/Icon_Common.png) no-repeat;
    }
    .Icon_Gold {
        background: url(../../../Content/webImgs/TraceSource/OriginsMaterialList/Icon_Gold.png) no-repeat;
    }
    .Icon_Platinum {
        background: url(../../../Content/webImgs/TraceSource/OriginsMaterialList/Icon_Platinum.png) no-repeat;
    }
    .Icon_Diamond {
        background: url(../../../Content/webImgs/TraceSource/OriginsMaterialList/Icon_Diamond.png) no-repeat;
    }
</style>
<div class="mtlr15">
    <div class="row">
        <div class="col-lg-8 col-md-8 col-sm-8" style="padding:0"></div>
        <div class="col-lg-4 col-md-4 col-sm-4">
            <div class="input-group">
                <input type="text" id="where" class="form-control" placeholder="素材名称" onkeydown="if (event.keyCode == 13) { $.MGJ.OriginsMaterial.Ajax_GetOriginsMaterialList(1); }">
                <span class="input-group-addon" onclick="$.MGJ.OriginsMaterial.Ajax_GetOriginsMaterialList(1);">
                    <span class="glyphicon glyphicon-search"></span>
                </span>
            </div>
        </div>
    </div>

    <div>
        <div class="TSB_BodyTop">
            <input type="checkbox" class="AllClickCheckbox"/>
            <span>全选</span>
            <button class="btn btn-success" onclick="$.MGJ.OriginsMaterial.Dialog_Add()">新增</button>
            @*<button class="btn btn-default" onclick="BatchDels()">删除</button>*@
        </div>
        <ul class="TSB_Body" style="display:none" id="OMID" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.OriginsMaterial.Ajax_GetOriginsMaterialList','emptyHtml':OMID_EmptyHtml}">
            <li class="container-fluid container">
                <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
                    <div style="float:left;margin-left:13px">
                        <input style="margin-top:13px;" type="checkbox" class="text-left AllClickChild" name="Check" id="Check"/>
                    </div>
                    <div class="div_icon Icon_Common" binding="{'class':'MaterialType','classHandle':$.MGJ.OriginsMaterial.BindMaterialLogo}" style=" float:left; margin:0 5px;">
                    </div>
                    <div style="float: left; margin: 0 5px">
                        <div class="ChangeNameDiv" style="font-weight:600">
                            <span class="ChangeNameDivChild" binding="{'text':'MaterialName'}"></span>
                            <span onclick="$.MGJ.OriginsMaterial.ChangeNameDiv(this)" class="glyphicon glyphicon-pencil"></span>
                        </div>
                        <div>
                            <input binding="{'ID':'MaterialId'}" onblur=" $.MGJ.OriginsMaterial.ChangeNameInp(this)" class="ChangeNameInp" style="display:none" type="text" placeholder="请输入溯源码名称" />
                        </div>
                        <div>
                            <span binding="{'text':'ChangeDate','textHandle':'datetime_Date'}"></span>
                        </div>
                        <div class="zzotw" style="word-break: break-all;max-width:600px; " binding="{'text':'Remark'}"></div>                 
                        <img class="TSB_Body_Img" src="~/Content/webImgs/TraceSource/OriginsMaterialList/default_dt1.jpg" />
                    </div>
                </div>
                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3" style="display:flex;display:-webkit-flex;align-items: center;">
                    <button binding="{'ID':'MaterialId'}" class="btn btn-success" onclick="Preview(this)">预览</button>
                    <button binding="{'ID':'MaterialId'}" class="btn btn-success" onclick="Edit(this)" >编辑</button>
                    @*<button binding="{'ID':'MaterialId'}" class="btn btn-default">二维码</button>*@
                    <button binding="{'ID':'MaterialId'}" class="btn btn-success" onclick="$.MGJ.OriginsMaterial.Ajax_DelMaterial(this)">删除</button>
                </div>
            </li>
        </ul>
    </div>
    <div id="ShoppingPager"></div>
</div>
<script>
    window.OMID_EmptyHtml = '<li class="no-result text-center" style="display:block"> 无符合条件的数据结果 </li>';
    $(function () {
        $.MGJ.OriginsMaterial.Ajax_GetOriginsMaterialList(1, "");
    });

    //预览
    function Preview(obj) {
        var materialId=$(obj).attr("ID");
        $.MGJ.Common._PrewView(materialId, 0);
    }

    //编辑
    function Edit(obj) {
        $.MGJ.OriginsMaterial.Dialog_Edit(obj);
    }
</script>



